package com.azu.bitmapworker.common;

import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.util.Log;
import android.widget.ImageView;

import com.azu.bitmapworker.core.BitmapDisplayConfig;
import com.azu.bitmapworker.core.BitmapDisplayer;

import java.io.InputStream;

/**
 * Created by zhangmian on 14-1-16.
 */
public class CommonBitmapDisplayer implements BitmapDisplayer {


	@Override
	public void show(ImageView imageView, Drawable drawable, BitmapDisplayConfig config) {
		if (drawable != null) {
			Log.i("CommonBitmapDisplayer", "show(ImageView, Drawable)-success");
			imageView.setImageDrawable(drawable);
		}
	}

	@Override
	public void show(ImageView imageView, Bitmap bitmap, BitmapDisplayConfig config) {
		if(bitmap != null){
			Log.i("CommonBitmapDisplayer", "show(ImageView, Bitmap)-success, ImageView:" + imageView + ", Bitmap:" + bitmap);
			imageView.setImageBitmap(bitmap);
		}
	}


	@Override
	public void show(ImageView imageView, InputStream inputStream, BitmapDisplayConfig config) {

	}

}
